package cz.muni.fi.pa165.soap.client;

import cz.muni.fi.pa165.soap.CustomerDTO;
import java.util.List;

/**
 *
 * @author shifty
 */
public class CustomerTableModel extends TableModel {
    
    public CustomerTableModel(String[] columns) {        
        super(columns);
    }
    
    public void setValuesFromList(List<CustomerDTO> list) {
        Object[][] values = new Object[list.size()][getColumnCount()];
        int i=0;
        
        for(CustomerDTO c : list) {
            values[i][0]=c.getId();
            values[i][1]=c.getName();
            values[i][2]=c.getAddress();
            values[i][3]=c.getCity();
            values[i][4]=c.getZip();
            values[i][5]=c.getCountry();
            values[i][6]=c.getAccountNumber();
            i++;
        }
        setValues(values);
    } 
    
}
